The present invention relates to a circle (including ellipse and circular arc) generator using a graphic display unit or the like.
When a circle is drawn on a graphic display unit of a personal computer or the like, calculations for sine and cosine are performed to obtain accurate graphic data. However, it takes time to calculate the sine and cosine values. For this reason, conventionally, an inscribed regular polygon having a predetermined internal angle is used to draw an approximate circle. Alternatively, peripheral dots of a quadrant are calculated, and the remaining quadrants are obtained as symmetrical ones about the x-axis, the y-axis and the origin, thereby increasing the drawing or generation speed.
As described above, when a given point is calculated, and then points symmetrical with the given point about the x-axis, the y-axis and the origin are calculated, only sign inversion is required if the center of the resultant circle corresponds to the origin of the x-y coordinate system. However, when the center of the circle does not coincide with the origin of the coordinate system, coordinate data corresponding to the center of the circle must be stored in a memory, and addition and subtraction must be performed with reference to the data of the origin. As a result, calculation processing becomes complicated, thereby decreasing the processing speed.
On the other hand, when a circle is drawn using an inscribed regular polygon, the cosine and sine values are calculated at a given interval such as 5, 10 or 15 degrees (the interval becomes small when a larger circle is drawn). A sufficiently precise circle can be drawn by using a regular polygon in a personal computer or the like. However, when an angle between the reference point (origin or center) and the start point of a circular arc is calculated, and an end angular position is calculated, the interval of 5, 10 or 15 degrees becomes insufficient. A smaller interval is required, so that the memory capacity of the table is increased, resulting in inconvenience. In addition, only sine and cosine values in the range of 0 to 90 degrees are stored in the table. Therefore, the CPU or the like must detect whether the sine or cosine value is positive or negative. Furthermore, when four points consisting of one reference point and three other points symmetrical therewith are simultaneously plotted in the x-y coordinate system, the symmetrical points may/may not be drawn in accordance with the quadrants of the x-y coordinate system. In addition to this disadvantage, when a means is provided to determine whether or not each of the four dots is plotted, the processing time is prolonged, resulting in inconvenience. In the case of simultaneously plotting all four dots or points in the x-y coordinate system, the calculation is performed only for the dot in the first quadrant (i.e., P(+x,+y)). Therefore, when the signs of the coordinates for drawing a circular arc have to be considered, circular arc generation processing becomes complicated.